//
//  WeiboViewController.m
//  南京大牌档
//
//  Created by student on 14-1-9.
//  Copyright (c) 2014年 无锡第三团队. All rights reserved.
//

#import "WeiboViewController.h"

@interface WeiboViewController ()

@end

@implementation WeiboViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    if([CLLocationManager locationServicesEnabled]) {
        CLLocationManager *locationManager=[[CLLocationManager alloc]init];
        
        locationManager.delegate = self;
        [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
        [locationManager startUpdatingLocation];
        NSLog(@"%d",[CLLocationManager locationServicesEnabled]);
    }else {
        UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"提示" message:@"请打开定位并允许应用执行权限" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
        [alertView show];
    }
}

- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
        NSLog(@"???");
        CLLocationCoordinate2D coor2D=newLocation.coordinate;
        NSLog(@"%f,   %f",coor2D.latitude,coor2D.longitude);
        //    [manager stopUpdatingLocation];
    }

    
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
